<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="assets/images/favicon.png" type="image/png">
    <title></title>
    <link href="assets/css/icons.css" rel="stylesheet">
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.min.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->

</head>

<body class="sticky-header">


<!--Start login Section-->
<section class="login-section">
    <div class="container">
        <div class="row">
            <div class="login-wrapper">
                <div class="login-inner">

                    <div class="logo">
                        <img src="assets/images/logo-dark.png"  alt="logo"/>
                    </div>

                    <div style="margin-bottom: 20px">
                        <h2 class="header-title text-center">登录</h2>
                    </div>

                    <form >
                        <div class="form-group">
                            <input id="userName" type="text" class="form-control"  placeholder="userName" >
                        </div>

                        <div class="form-group">
                            <input id="password" type="text" class="form-control"  placeholder="password" >
                        </div>

                        <div class="form-group">
                            <div class="pull-right">
                                <a href="updatePassword.html" class="a-link">
                                    <i class="fa fa-unlock-alt"></i> 忘记密码?
                                </a>
                            </div>
                        </div>

                        <div class="form-group">
                            <input type="button"  onclick="loginpass()" value="Login" class="btn btn-primary btn-block" >
                        </div>

                        <div class="form-group text-center">
                            没有账号?  <a href="registration.html">注册 </a>
                            <a href="loginphone.html">||手机登录 </a>
                            <a href="index.html"> ||首页 </a>
                        </div>

                    </form>

                    <div class="copy-text">
                        <p class="m-0">2021 &copy; Meter admin</p>
                    </div>

                </div>
            </div>

        </div>
    </div>
</section>
<!--End login Section-->




<!--Begin core plugin -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src = "assets/js/util/http-util.js"></script>
<!-- End core plugin -->

</body>
<script>
    function loginpass() {
        let url = "/loginpass";
        let userName =  $("#userName").val();
        let password =  $("#password").val();
        if (userName==""){
            alert("用户名不能为空");
            return false;
        }
        if (password==""){
            alert("密码不能为空");
            return false;
        }
        let params ={userName : userName, password : password};
        doPost(url,params,function (json) {
            location.href = "index.html";
            alert("登录成功");
        });

    }
</script>

</html>
